#pragma once

typedef struct{
	char	tag[8];
	int		userID;
}ClientWelcomeMessage;

typedef struct{
	char	tag[6];
	time_t	current_time;
}ClientLoginMessage;

typedef struct{
	char	tag[5];
	time_t	current_time;
}ClientTimeMessage;

typedef struct{
	char	tag[5];
	int		id;
	float	posRot[7];
}BodyUpdate;

typedef struct{
	char	tag[8];
	int		targetSpriteID;
	int		controlBits;
}ClientControl;

typedef union{

	ClientWelcomeMessage	welcome;
	ClientLoginMessage		login;
	ClientTimeMessage		time;				/* Current time */
	BodyUpdate				body;
	ClientControl			control;
}NetworkDGram;

#define	MakeNetworkDGram(dg,mtype){sprintf(&dg.mtype.tag[0],"%s",(char*)#mtype);}
